import { connect } from 'react-redux'
import { markDone } from '../actions'
import TodoList from '../components/TodoList'
import { ShowTodos } from '../actions'

const getVisibleTodos = (todos) => {
      return todos
}

const mapStateToProps = state => ({
  todos: getVisibleTodos(state.todos, state.visibilityFilter)
})

const mapDispatchToProps = dispatch => ({
  markDone: id => dispatch(markDone(id))
})

export default connect(
  mapStateToProps,
  mapDispatchToProps
)(TodoList)